======================================================================
  Apple Disk Transfer (ADT) Using Cassette IO As RS-232 Serial Port.
======================================================================
  Edited 2016 (for personal use) by: James Davis, Beagle Buddy #227.
======================================================================


            Moving Apple II DOS 3.3 disk images to MS-DOS

               Warren Toomey, wkt@csadfa.cs.adfa.oz.au


In a recent Usenet article in alt.hackers [before 9/5/1993], I wrote:

"My Apple II didn't have a serial port, but I wanted to move my disk
images over to a PC so I could use the Apple II emulator.  So I found
the spot on the board which gave cassette output, but at 0/5V, and
used that as the RS-232 output wire.  The casette input could cope
with +/-12V, so I used it as is for RS-232 input.  Then all I had to
do was code up some 9600 baud character i/o routines in assembly."

"As an extra hack, I altered DOS 3.3 so that, when it was read/writing
a block to/from any disk but the default, it went to a new section of
code that acted as a `disk client' which asked to read/write sectors
using my serial i/o code.  I had a disk server running on the PC.
Thus, I was able to not only move my disk images to the PC (a straight
disk copy!), but also had another 12 virtual disks on my Apple, albeit
only running at around 960 bytes per second transfer speed."


This archive contains the code described above.  There is not a great
deal of program comments for either the client or the server, but any-
body with some idea of 6502 assembly, C programming and DOS 3.3 RWTS
shouldn't have too much trouble.


















======================================================================
                                Page 1
======================================================================
  Apple Disk Transfer (ADT) Using Cassette IO As RS-232 Serial Port.
======================================================================

Connecting the Apple and the PC
-------------------------------

You first need to connect the Apple to a serial port, like this:

----------------------------------------------------------------------
      Apple II Connection                     IBM-PC Connection
-------------------------------        -------------------------------
                                              DB-25   Signal   DE-9
                                              ------  ------   -----

                                       diode
Cassette in ----------------------------|<|-- Pin 2 --- TD --- Pin 3

Cassette out 0-5V --------------------------- Pin 3 --- RD --- Pin 2

Ground -------------------------------------- Pin 7 --- SG --- Pin 5

                                        +---- Pin 4 --- RTS -- Pin 7
                                        |
                                        +---- Pin 5 --- CTS -- Pin 8

                                        +---- Pin 6 --- DSR -- Pin 6
                                        |
                                        +---- Pin 8 --- DCD -- Pin 1
                                        |
                                        +---- Pin 20 -- DTR -- Pin 4

----------------------------------------------------------------------

On the PC side, you should join pins 4,5 together, and pins 6,8,20
together.  Pin 2 goes via a diode to CASSIN on the Apple.  You need to
find a 5V version of CASSOUT on the Apple to connect to pin 3.  I have
an Apple II clone (different motherboard), but I found a 5V spot near
the real CASSOUT.

Next, you need to assemble the source code SERIAL8.SRC supplied.  This
goes at $9B00 in the Apple, and gives 9600 baud i/o, plus a file
client.  Either type the assembly in & assemble it, or type the hex in
and check it with 9B00L.  You should BSAVE SERIAL8.OBJ,A$9B00,L$160.

I've supplied the server code, plus a PC binary that runs as is, using
COM2:.

Ok, with the power off, connect the PC & Apple together.  Then boot
the Apple and BLOAD SERIAL8.OBJ,A$9B00.  Run Kermit on the PC, set at
8-bit, no parity, 9600 baud, Com2:.  CALL -151.  9B03G.  You should

======================================================================
                                Page 2
======================================================================
  Apple Disk Transfer (ADT) Using Cassette IO As RS-232 Serial Port.
======================================================================

get the monitor prompt '*' under Kermit.  Type ^C RET to get back to
DOS 3.3 & play.  You can list programs etc using this.  This also
tests to make sure the 9600 baud routines work.

Ok, hit RESET on the Apple.  Now, either do B7B9:9B, or POKE 47033,155
to connect the client into DOS 3.3.  Exit Kermit and start aplserv on
the PC.  Now, you can INIT HELLO,S3 for example, & the server should
show the DOS 3.3 & HELLO being written to the file disk_3a.dsk.  After
this you should be able to CATALOG etc. as per normal.

I suggest BLOAD SERIAL8.OBJ & the POKE in a HELLO program, to make it
automatic.

You can use slots 0-5 and 7, drives 1-2.

I use FILER or my own DISK COPY to copy disk images from the apple
drives to the PC server.  Remember you have 14 pseudo-drives, so you
can copy 14 sides before stopping the server.  It takes about 3 mins a
side, though.  You can use these 140K images with the Apple Emulator,
you just have to rename them as disk6a.dsk (to boot), or disk6b.dsk.

Also, before running FILER, do a CATALOG on any pseudo-drive, and
RESET before you get garbage back from the server.  FILER for some
reason doesn't work unless you access the server before it is run.

Finally, shut down the server as follows:

        - go over to the server & type ctrl-break

        - go back to the apple & try & catalog a different disk than
          the one you last used, e.g S1, D1 instead of S5, D1.

The server will fclose the current open disk, open the new one & try &
print out a message, then die because of the ctrl-break.  Tacky but it
works.

I also have all my apple disks as 140K images on the PC.  I've
included my catalog 'wktcatalog'.  I am willing to make these 140K
images available via anonymous ftp on minnie.cs.adfa.oz.au, subdir
apple2/images.  However, disk space is tight on minnie, and so I may
remove images on a LRU basis.  Also, the images will archived using
MS-DOS PKZIP 2.04.  That shouldn't be a problem as you'll probably
want to use them under the Apple Emulator anyway.

Cheers,

        Warren Toomey, wkt@csadfa.cs.adfa.oz.au

======================================================================
                                Page 3
======================================================================
   Non-Apple DB25 and DE9 Serial Ports (RS-232 Interface Standard)
======================================================================

Pinouts are shown as if you're looking at the back of a PC.

DB-25:  ,----------------------------------------------------.
        \ 13  12  11  10  09  08  07  06  05  04  03  02  01 /
         \  25  24  23  22  21  20  19  18  17  16  15  14  /
          `------------------------------------------------
DE-9:                    ,-------------------.
                         \ 5   4   3   2   1 /
                          \  9   8   7   6  /
                           `---------------

----------------------------------------------------------------------
  Pin#   DB-25  DE-9   Function          (DB-25 / DE-9)
  ----   -----  ----   -----------------------------------------------
Shield   Gnd    Gnd    Protective Ground (0DCV) / Shield Ground (0DCV)
     1   Gnd    DCD    Ground (0DCV)            / Data Carrier Detect
     2   TD     RD     Transmitted Data         / Received Data
     3   RD     TD     Received Data            / Transmitted Data
     4   RTS    DTR    Request To Send          / Data Terminal Ready
     5   CTS    SG     Clear To Send            / Signal Ground (0DCV)
     6   DSR    DSR    Data Set Ready           / Data Set Ready
     7   SG     RTS    Signal Ground (0DCV)     / Request To Send
     8   DCD    CTS    Data Carrier Detect      / Clear To Send
     9   +DCV   RI     Positive DC Test Voltage / Ring Indicator
  ------------------   -----------------------------------------------
    10   -DCV          Negative DC Test Voltage [DCE->DTE]*
    11   QM            Equalizer Mode
    12   (S)DCD        Secondary Data Carrier Detect
    13   (S)CTS        Secondary Clear To Send
    14   (S)TD, NS     Secondary Transmitted Data, or New Sync, or
                       Fault on IW1
    15   TC            Transmitter Clock [DCE->DTE]
    16   (S)RD,        Secondary Received Data, or
         DCT           Divided Clock Transmitter
    17   RC            Receiver Clock
    18   DCR           Divided Clock Receiver
    19   (S)RTS        Secondary Request To Send
    20   DTR           Data Terminal Ready
    21   SQ            Signal Quality Detect
    22   RI            Ring Indicator
    23                 Data Rate Selector [Bidirectional]
    24   (TC)          Ext. Transmitter Clock [DTE->DCE]
    25                 Busy
----------------------------------------------------------------------
  * DCE - Data Communications Equipment (e.g., a MoDem)
  * DTE - Data Terminal Equipment (e.g., a Monitor/CRT)
----------------------------------------------------------------------

======================================================================
                                Page 4
